﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.Master" AutoEventWireup="true"
    CodeBehind="Cyberminer.aspx.cs" Inherits="Hestia_Cyberminer.index" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <style>
        /*AutoComplete flyout */
        .autocomplete_highlightedListItem
        {
            background-color:#D4D7EF;
            }
        .autocomplete_completionListElement
        {
            margin: 0px !important;
            background-color: white;
            color: windowtext;
            border: buttonshadow;
            border-width: 1px;
            border-style: solid;
            cursor: 'default';
            overflow: auto;
            height: 200px;
            text-align: left;
            list-style-type: none;
        }
        .style1
        {
            font-weight: bold;
            text-decoration: underline;
        }
    </style>
    <link href="Styles/Master.css" rel="stylesheet" type="text/css" />
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div class="OtherPages">
    <div>
        <asp:ToolkitScriptManager ID="ToolkitScriptManager" runat="server">
        </asp:ToolkitScriptManager>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<asp:CheckBox 
            ID="cbXray" runat="server" OnCheckedChanged="cbXray_CheckedChanged"
            Text="X-ray" 
            ToolTip="Check X-ray to see the KWIC System, Circular Shift, Noise Eliminator, Alphabetizer in action" />
        <br />
        <asp:Label ID="lblWarningMaxLen" runat="server" 
            Text="Max Length: 798 Characters"></asp:Label>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <asp:CheckBox ID="cbCaseSensitive" runat="server" Text="Case-sensitive" 
            ToolTip="Check to enable Case-Sensitive Search." />
        <br />
        <asp:TextBox ID="txtSearch" runat="server" Height="22px" Width="500px" 
            MaxLength="800" 
            ToolTip="Enter Search Text Here Autocomplete is Supported but ensure javascript is enabled in your browser. "></asp:TextBox>
        <asp:AutoCompleteExtender runat="server" BehaviorID="AutoCompleteEx" ID="autoComplete"
            TargetControlID="txtSearch" ServicePath="~/AutoComplete.asmx" ServiceMethod="GetCompletionList"
            MinimumPrefixLength="1" CompletionInterval="1000" EnableCaching="true" CompletionSetCount="20"
            CompletionListCssClass="autocomplete_completionListElement" CompletionListItemCssClass="autocomplete_listItem"
            CompletionListHighlightedItemCssClass="autocomplete_highlightedListItem" DelimiterCharacters=";,.:"
            ShowOnlyCurrentWordInCompletionListItem="true">
            <Animations>
                    <OnShow>
                        <Sequence>
                        
                            <OpacityAction Opacity="0" />
                            <HideAction Visible="true" />
                            
                           
                            <ScriptAction Script="
                                // Cache the size and setup the initial size
                                var behavior = $find('AutoCompleteEx');
                                if (!behavior._height) {
                                    var target = behavior.get_completionList();
                                    behavior._height = target.offsetHeight - 2;
                                    target.style.height = '0px';
                                }" />
                            
                            <%-- Expand from 0px to the appropriate size while fading in --%>
                            <Parallel Duration=".4">
                                <FadeIn />
                                <Length PropertyKey="height" StartValue="0" EndValueScript="$find('AutoCompleteEx')._height" />
                            </Parallel>
                        </Sequence>
                    </OnShow>
                    <OnHide>
                        <%-- Collapse down to 0px and fade out --%>
                        <Parallel Duration=".4">
                            <FadeOut />
                            <Length PropertyKey="height" StartValueScript="$find('AutoCompleteEx')._height" EndValue="0" />
                        </Parallel>
                    </OnHide>
            </Animations>
        </asp:AutoCompleteExtender>
        <script type="text/javascript">
            // Work around browser behavior of "auto-submitting" simple forms
            var frm = document.getElementById("aspnetForm");
            if (frm) {
                frm.onsubmit = function () { return false; };
            }
        </script>
        <%-- Expand from 0px to the appropriate size while fading in --%>
        <input type="submit" style="display: none;" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <asp:Button ID="btnSearch" runat="server" Text="Search" 
            OnClick="btnSearch_Click" ToolTip="Click to start the Search Process" />
        &nbsp;&nbsp;&nbsp;
        <br />
        <asp:RegularExpressionValidator ID="revSearch" runat="server" ControlToValidate="txtSearch"
            
            ErrorMessage="Only alphanumneric &amp; whitespace characters are allowed. " 
            ValidationExpression="[a-zA-Z0-9\s\.]*" ForeColor="Red"></asp:RegularExpressionValidator>
        <asp:RequiredFieldValidator ID="rfvtxtSearch" runat="server" 
            ControlToValidate="txtSearch" ErrorMessage="Please Enter Some Text" 
            ForeColor="Red"></asp:RequiredFieldValidator>
        <br />
        <asp:RadioButtonList ID="rblAndOrNot" runat="server" 
            RepeatDirection="Horizontal" 
            ToolTip="AND, Search Word1 &amp; Word2. OR, Search Word1 or Word2. Not, Search Word1 and Word2 Not in Database.">
            <asp:ListItem>AND</asp:ListItem>
            <asp:ListItem Selected="True">OR</asp:ListItem>
            <asp:ListItem>NOT</asp:ListItem>
        </asp:RadioButtonList>
        <br />
        <asp:Label ID="lblDBError" runat="server"></asp:Label>
        <br />
        <hr />
        <asp:Panel ID="detailsPanel" runat="server" Visible="False">
            &nbsp;&nbsp;
            <asp:Label ID="lblSentences" runat="server" Style="font-weight: 700; text-decoration: underline"
                Text="1. Sentences"></asp:Label>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <asp:Label ID="lblCSList" runat="server" CssClass="style1" Text="2. Circular Shifts"></asp:Label>
            <br />
            &nbsp;<asp:ListBox ID="lboxSentences" runat="server" Height="100px" Width="400px"
                Enabled="False" SelectionMode="Multiple"></asp:ListBox>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <asp:ListBox ID="lboxCS" runat="server" Height="100px" Width="400px" Enabled="False">
            </asp:ListBox>
            <br />
            &nbsp;
            <asp:Label ID="lblNECS" runat="server" CssClass="style1" Text="3. Noise Eliminated Circular Shifts"></asp:Label>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <asp:Label ID="lblANECS" runat="server" CssClass="style1" Text="4. Alphabetized Noise Eliminated Circular Shift"></asp:Label>
            <br />
            &nbsp;<asp:ListBox ID="lboxNECS" runat="server" Height="100px" Width="400px" Enabled="False">
            </asp:ListBox>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <asp:ListBox ID="lboxANECS" runat="server" Height="100px" Width="400px" Enabled="False">
            </asp:ListBox>
            <br />
            &nbsp;
            <asp:Label ID="lblRS" runat="server" Style="font-weight: 700; text-decoration: underline"
                Text="Removed Sentences"></asp:Label>
            <br />
            &nbsp;<asp:ListBox ID="lboxRS" runat="server" Height="100px" Width="400px" Enabled="False">
            </asp:ListBox>
        </asp:Panel>
    </div>
    <hr />
    <div>
        <br />
        <asp:Label ID="lblSRText" runat="server" 
            style="font-weight: 700; text-decoration: underline" Text="Search Results:" 
            Visible="False"></asp:Label>
        <br />
        <asp:ListView ID="lvSearchResults" runat="server" Visible="False" OnPagePropertiesChanging="ChangePage">
            <AlternatingItemTemplate>
                <li style="">Descriptor:
                    <asp:Label ID="url_descriptorLabel" runat="server" Text='<%# Eval("url_descriptor") %>' />
                    <br />
                    Hyperlink:
                    <asp:HyperLink ID="HyperLink" runat="server" NavigateUrl='<%# Eval("url_hyplerlink") %>'
                        Text='<%# Eval("url_hyplerlink") %>'></asp:HyperLink>
                    <br />
                    Date Modified:
                    <asp:Label ID="date_modifiedLabel" runat="server" Text='<%# Eval("date_modified", "{0:D}") %>'></asp:Label>
                    <br />
                </li>
            </AlternatingItemTemplate>
            
            <ItemSeparatorTemplate>
                <br /><hr />
            </ItemSeparatorTemplate>
            <ItemTemplate>
                <li style="">Descriptor:
                    <asp:Label ID="url_descriptorLabel" runat="server" Text='<%# Eval("url_descriptor") %>' />
                    <br />
                    Hyperlink:
                    <asp:HyperLink ID="HyperLink" runat="server" NavigateUrl='<%# Eval("url_hyplerlink") %>'
                        Text='<%# Eval("url_hyplerlink", "{0}") %>'></asp:HyperLink>
                    <br />
                    Date Modified:
                    <asp:Label ID="date_modifiedLabel" runat="server" Text='<%# Eval("date_modified", "{0:D}") %>'></asp:Label>
                    <br />
                </li>
            </ItemTemplate>
            <LayoutTemplate>
                <ul id="itemPlaceholderContainer" runat="server" style="">
                    <li runat="server" id="itemPlaceholder" />
                </ul>
            </LayoutTemplate>
            <SelectedItemTemplate>
                <li style="">url_descriptor:
                    <asp:Label ID="url_descriptorLabel" runat="server" Text='<%# Eval("url_descriptor") %>' />
                    <br />
                    url_hyplerlink:
                    <asp:Label ID="url_hyplerlinkLabel" runat="server" Text='<%# Eval("url_hyplerlink") %>' />
                    <br />
                    date_modified:
                    <asp:Label ID="date_modifiedLabel" runat="server" Text='<%# Eval("date_modified") %>' />
                    <br />
                </li>
            </SelectedItemTemplate>
        </asp:ListView>
        <div>
        <center>
            <asp:DataPager ID="DataPager" PagedControlID="lvSearchResults" PageSize="10" runat="server">
                <Fields>
                    <asp:NextPreviousPagerField ButtonType="Button" ShowFirstPageButton="True" ShowNextPageButton="False"
                        ShowPreviousPageButton="False" />
                    <asp:NumericPagerField />
                    <asp:NextPreviousPagerField ButtonType="Button" ShowLastPageButton="True" ShowNextPageButton="False"
                        ShowPreviousPageButton="False" />
                </Fields>
            </asp:DataPager>
           </center>
        </div>
    </div>
    <p style="margin-left: 40px">
        <br />
    </p>
    </div>
</asp:Content>
